#pragma once
//============================================================================
// Copyright (C) 2009-2013 Brett R. Jones
//
// Issued to public domain 2013
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#include "VxFileXferInfo.h"
#include <vector>

class VxSktBase;
class VxNetIdentBase;

class VxBaseSktInfo
{
public:
	// base class for per connection info.. contains
	// whats needed for file transfers
	//=== vars ===//
	//=== socket vars ===//
	VxSktBase *					m_poSkt;			// socket
	U32							m_u32PeerIp;		// peer's ip in binary form
	char						m_as8PeerIp[16];	// peer's ip in ascii form
	U32							m_u32LocalIp;		// our ip in binary form
	char						m_as8LocalIp[16];	// our ip in ascii form
	U32							m_u32LastRxTime;	// last time received a packet
	//=== identity vars ===//
	VxNetIdentBase *			m_poIdent;			// network identity
	std::string					m_csUserName;		// users login name

	//=== file tx/rx vars ===//
	VxFileXferInfo				m_oTxFileInfo;		// file being transmitted
	VxFileXferInfo				m_oRxFileInfo;		// file being received
	std::vector<std::string>	m_astrFilesToSend;		// list of files to send
	std::vector<std::string>	m_astrFilesSent;		// list of files sent
	std::vector<std::string>	m_astrFilesRecieved;	// list of files received

	//=== constructor ===//
	VxBaseSktInfo();
	//=== destructor ===//
	virtual ~VxBaseSktInfo();

	//! return true if file is already in que to be sent or has been sent
	BOOL IsFileQuedOrSent( const char * pFileName );
	//! que a file to send
	void QueFileToSend( const char * pLclFileName, const char * pRmtFileName );
};
